<?php


namespace app\admin\validate;


use think\Validate;

class Category extends Validate
{
    protected $rule = [
        'pid' => 'require|integer',
        'name' => 'require',
    ];

    protected $message = [
        'pid.require' => 'pid不能为空',
        'pid.integer' => 'pid必须为数字',
        'name' => 'name不能为空'
    ];

    protected $scene = [
        'add' => [
            'pid',
            'name'
        ],
        'index' => [
            'pid'
        ],
    ];

}